package com.dollarxy.dlmall.auth;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;


/**
 * 核心原理
 * 1）、@EnableRedisHttpSession导入RedisHttpSessionConfiguration配置
 *      1、给容器中添加了一个组件
 *          RedisOperationsSessionRepository：Redis操作session，session的增删改查封装类
 *2、SessionRepositoryFilter==>Filter:session'存储过滤器﹔每个请求过来都必须经过filter
 * 1、创建的时候，就自动从容器中获取到了SessionRepositorysl I
 * 2、原始的request，response都被包装。sessionRepositoryRequestwrapper，SessionRepositoryResponsell
 * 3、以后获取session。request.getSession( );
 * / / SessionRepositoryRequestlwrapper
 * 4、wrappedRequest.gctSession( ) ;===> SessionRepository中获取到的。l
 * 装饰者模式;
 *自动延期;redis中的数据也是有过期时间。
 */

@EnableRedisHttpSession     //整合Redis作为session存储
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class DlmallAuthServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(DlmallAuthServerApplication.class, args);
    }

}
